#ifndef _INLINE_HPP_
#define _INLINE_HPP_

#include "include.hpp"
#include "itemdata.hpp"

class inline_text:public figure {
	string cvt_script;
public:

	inline_text(string newname, int lev, xlider_presentation* master):
	figure(newname,master){
		level=lev;
		type="inline";
	}

	virtual void read_theme(xml_config_reader& xc, param_handler& p, string ty){
		// take settings from item
		figure::read_theme(xc,p,"item"); // inherite item
		figure::read_theme_save(xc,p,ty);
		cvt_script=p.string_value("type");
	}

	virtual string invoke(string destype="png"){
		// only to png and pdf!
		string fout=name+"."+destype;
		string cmd("echo '");
		cmd.append(text);
		cmd.append("'|sh ");
		cmd.append(get_scriptpath(cvt_script)+" "+fout);
		system(cmd.c_str());
		assert(file_exist(fout),"fail to invoke generator", cvt_script);
		garbage.push_back(fout);
		return fout;
	}
	
};

#endif
